package com.song.util.excel;

import cn.afterturn.easypoi.excel.entity.result.ExcelVerifyHandlerResult;
import cn.afterturn.easypoi.handler.inter.IExcelVerifyHandler;
import com.song.entity.school.Student;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

@Component
public class StudentExcelVerifyHandler implements IExcelVerifyHandler<Student> {
    @Override
    public ExcelVerifyHandlerResult verifyHandler(Student student) {
        ExcelVerifyHandlerResult result = new ExcelVerifyHandlerResult(true);
        if (
                StringUtils.isBlank(student.getXb())
                && StringUtils.isBlank(student.getXh())
                && StringUtils.isBlank(student.getXm())
                && student.getCsrq() == null
        ){
            result.setSuccess(false);
            result.setMsg("空行数据");
        }
        return result;
    }
}
